﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace Project01
{
    class MonsterType04:Monster
    {
         public MonsterType04(Game game ,int Position)
            : base(game,Position)
        {
                this.ObjectTexture = game.Content.Load<Texture2D>("Images/Monster/Mtype04");
                this.Sprite = new AnimationSprite(ObjectTexture, 1, 4);
                this.Speed = 2;
                this.Sprite.Position = new Vector2(Ran.Next(0+Sprite.RecWidth,game.Window.ClientBounds.Width-Sprite.RecWidth),0-Sprite.RecHeight);
                this.Health = 5;
                this.game = game;
        }
         public override void Update(GameTime gameTime)
         {
             this.Sprite.Update();
             this.Sprite.Position.Y += Speed;
             if (this.Sprite.Position.Y >= game.Window.ClientBounds.Height + this.Sprite.RecHeight)
                 Active = true;
             base.Update(gameTime);
         }
         private void UpdateBullets(GameTime gameTime)
         {

             for (int i = 0; i < Mbullets.Count; i++)
             {

                 Mbullets[i].Sprite.Update();

                 if (Mbullets[i].Sprite.Position.Y >= game.Window.ClientBounds.Height + Mbullets[i].Sprite.RecHeight)
                     Mbullets.RemoveAt(i);

             }

         }
         public override void Draw(SpriteBatch SpriteBatch)
         {
             this.Sprite.Draw(SpriteBatch);
             for (int i = 0; i < Mbullets.Count; i++)
             {
                 Mbullets[i].Sprite.Draw(SpriteBatch);
             }
             base.Draw(SpriteBatch);
         }
    }
}
